package com.example.kafkaspringboot.consumer;

import com.example.kafkaspringboot.config.KafkaSpringBootConfig;
import lombok.extern.slf4j.Slf4j;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author He Changjie on 2021/6/30
 */
@RestController
@RequestMapping

@Slf4j
public class Consumer1 {

    /**
     * 消费消息
     */
    @KafkaListener(topics = KafkaSpringBootConfig.TOPIC, groupId = KafkaSpringBootConfig.GROUP_ID)
    public void listener(String input){
        log.warn("===========kafka message input value: {}",input);
    }
}
